<!--
 * @FilePath     : /study_code/layui/6-3-11.html
 * @Description  : layer.style(index, obj)
 * @Date         : 2025-04-08 17:33:58
 * @Author       : Fang YingGui
 * @LastEditors  : fangyinggui 18715384437@163.com
 * @LastEditTime : 2025-04-08 17:34:46
-->

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>documentName</title>
    <link rel="stylesheet" href="/layui/dist/css/layui.css" />
  </head>
  <body>
    <script src="/layui/dist/layui.js"></script>
    <script>
      /**
       * @brief: 重新给层设置样式
       * !对 loading 层和 tips 层无效
       * @param {Number} index, 某层的索引值
       * @param {Object} options, 任意的（大驼峰）CSS样式名&键值对
       * @return {*}
       */
      // layer.style(index, options);
      // 对loading层和tips层无效

      var index = layer.open({
        content: 'test',
      })
      //重新给指定层设定width、top等
      layer.style(index, {
        width: '1000px',
        top: '10px',
      })
    </script>
  </body>
</html>
